package com.clinic.entity.gui;

import java.util.Date;

import com.clinic.entity.type.GenderType;
import com.clinic.util.CommonUtil;

public class GuiPatient extends GuiUser {
	
	private Date dob;
	private int age;
	private String gender;
	private GuiPrescription guiPrescription;
	
	public String getDobString() {
		return CommonUtil.getDateStringFormatByDate(dob);
	}
	
	public void setDobString(String dobString) {
		this.dob = CommonUtil.getDateByStringFormat(dobString);
	}
	
	public Date getDob() {
		return dob;
	}
	
	public void setDob(Date dob) {
		this.dob = dob;
	}
	
	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public GenderType getGenderType() {
		return GenderType.getValue(getGender());
	}
	
	public boolean isMale() {
		return GenderType.MALE == getGenderType();
	}
	
	public boolean isFemale() {
		return GenderType.FEMALE == getGenderType();
	}
	
	public String getGender() {
		return gender;
	}
	
	public void setGender(String gender) {
		this.gender = gender;
	}

	public boolean isExistGuiPrescription() {
		return guiPrescription != null && guiPrescription.isAvailable();
	}
	
	public GuiPrescription getGuiPrescription() {
		return guiPrescription;
	}

	public void setGuiPrescription(GuiPrescription guiPrescription) {
		this.guiPrescription = guiPrescription;
	}
	
}
